/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package at.nhmwien.schema_mapping_tool.schemes;

import java.util.HashMap;
import java.util.LinkedHashMap;

/**
 *
 * @author wkoller
 */
public class SchemaHandler {
    private static SchemaHandler mySelf = null;
    private HashMap<String,Schema> availableSchemes = null;

    public static SchemaHandler self() {
        if( SchemaHandler.mySelf == null ) {
            SchemaHandler.mySelf = new SchemaHandler();
        }

        return SchemaHandler.mySelf;
    }

    private SchemaHandler() {
        this.availableSchemes = new HashMap<String,Schema>();

        this.availableSchemes.put( "ese-v3.2", new EseV32() );
        this.availableSchemes.put( "Marc 21", new Marc21() );
    }

    public String[] getAvailableSchemes() {
        return this.availableSchemes.keySet().toArray(new String[0]);
    }

    public LinkedHashMap<String,LinkedHashMap> getSchemaFields( String schemaName ) {
        return this.availableSchemes.get(schemaName).getSchemaContent();
    }
}
